from django.conf.urls import url
from django.urls import path

from . import views

app_name='users'

urlpatterns = [
    # 注册
    url(r'^register/$', views.RegisterView.as_view(), name='register'),
    url(r'^usernames/(?P<username>[a-zA-Z0-9_]{5,20})/count/$',views.RegisterUsernameCountView.as_view(),name='username'),
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$',views.RegisterMobileCountView.as_view(),name='mobile'),
    url(r'^login/$',views.LoginView.as_view(),name='login'),
    url(r'^logout/$',views.LogoutView.as_view(),name='logout'),
    url(r'^info/$',views.UserInfoView.as_view(),name='info'),
    url('^emails/$', views.EmailView.as_view(),name='emails'),
    url('^emails/verification/$', views.VerifyEmailView.as_view()),
    url('^addresses/$', views.AddressView.as_view()),
    url('^addresses/create/$', views.CreateAddressView.as_view()),
    url('^addresses/(?P<address_id>\d+)/$', views.UpdateDestroyAddressView.as_view()),
    url('^addresses/(?P<address_id>\d+)/default/$', views.DefaultAddressView.as_view()),
    #url('^addresses/(?P<address_id>\d+)/title/$', views.AddressTitleView.as_view()),
    url('^password/$', views.PwdView.as_view()),
]